home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / devices / lpdev.zoo / lpflush.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-03  |  465 b   |  24 lines

  1. /*
  2.  * lpflush.c: flushes the "/dev/lp" buffer. Very useful when you want
  3.  * to stop a catastrophy without rebooting the computer
  4.  */
  5.  
  6. #include "lpdev.h"
  7.  
  8. int main()
  9. {
  10.     int fp, ret;
  11.     
  12.     fp = Fopen("u:\\dev\\lp", 0);
  13.     if (fp < 0) {
  14.         Cconws("lpflush: can't open \"" DEVNAME "\"\r\n");
  15.         return fp;
  16.     }
  17.     ret = Fcntl(fp, 0L, TIOCFLUSH);
  18.     if (ret < 0) {
  19.         Cconws("lpflush: can't flush \"" DEVNAME "\"\r\n");
  20.         return ret;
  21.     }
  22.     return 0;  /* Ok */
  23. }
  24.